package com.ctbri.containerindepth;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

import com.ctbri.arrays.RandomGenerator;
import com.ctbri.util.CollectionData;

public class Ex30 {

	public static void sortTest(List<Integer> list, int size) {
		list.addAll(CollectionData.list(new RandomGenerator.Integer(), size));
		System.out.println(list.getClass().getSimpleName());
		long start = System.currentTimeMillis();
		Collections.sort(list);
		System.out.println(System.currentTimeMillis() - start);
	}
	
	public static void main(String[] args) {
		sortTest(new ArrayList<>(), 10000);
		sortTest(new LinkedList<>(), 10000);
	}

}
